package cn.ym.ymcc.fallback;

import cn.ym.ymcc.feign.MediaServerFeign;
import cn.ym.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignFallbackFactory implements FallbackFactory<MediaServerFeign> {

    @Override
    public MediaServerFeign create(Throwable throwable) {
        return new MediaServerFeign() {
            @Override
            public JSONResult listByCourseId(Long courseId) {

                return JSONResult.error("服务繁忙，请稍后再试！！！");
            }
        };
    }
}
